﻿using AutoMapper;
using Pay.Data;
using Pay.DTO;
using Pay.IService;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Pay.Service.AutoMapper {
  
    public class TokenGradeMapper : IStartupDto {
        private IMapperConfigurationExpression _cfg;
        public TokenGradeMapper(IMapperConfigurationExpression cfg) {
            _cfg = cfg;
        }
        public void Execute() {
            Create();
        }
        protected virtual void Create() {
            _cfg.CreateMap<TokenGrade, token_grade_dto>()
                .ForMember(dest => dest.id, src => src.MapFrom(c => c.Id))
                .ForMember(dest => dest.name, src => src.MapFrom(c => c.Name))
                .ForMember(dest => dest.grade_no, src => src.MapFrom(c => c.GradeNo))
                .ForMember(dest => dest.sort, src => src.MapFrom(c => c.UpFee))
                .ForMember(dest => dest.remark, src => src.MapFrom(c => c.Remark))
                .ForMember(dest => dest.is_enable, src => src.MapFrom(c => c.IsEnable))
                .ForMember(dest => dest.user_type, src => src.MapFrom(c => c.UserType));
        }
    }
}